local juejing = fk.CreateSkill {

  name = "joy__juejing",

  tags = { Skill.Compulsory, },

}



juejing:addEffect(fk.EnterDying, {
  name = "joy__juejing",
  anim_type = "drawcard",
  frequency = Skill.Compulsory,
  events = {fk.EnterDying, fk.AfterDying},
  on_use = function(self, event, target, player, data)
    player:drawCards(1, juejing.name)
  end,
})
juejing:addEffect(fk.AfterDying, {
  name = "joy__juejing",
  anim_type = "drawcard",
  frequency = Skill.Compulsory,
  events = {fk.EnterDying, fk.AfterDying},
  on_use = function(self, event, target, player, data)
    player:drawCards(1, juejing.name)
  end,
})

juejing:addEffect("maxcards", {
  name = "#joy__juejing_maxcards",
  correct_func = function(self, player)
    if player:hasSkill(juejing.name) then
      return 3
    end
  end
})

return juejing